import request from '@/utils/request'

const api_url = '/admin/hosp/hospital'

export default {
  // 分页查询医院列表
  getHospitalList(page, limit, searchObj) {
    return request({
      url: `${api_url}/${page}/${limit}`,
      method: 'get',
      params: searchObj // params： 参数对象；param：单个参数
    })
  },
  // 更新医院状态
  updateStatus(id, status) {
    return request({
      url: `${api_url}/updateStatus/${id}/${status}`,
      method: 'get'
    })
  },
  // 查询医院详情
  getHospital(hoscode) {
    return request({
      url: `${api_url}/show/${hoscode}/`,
      method: 'get'
    })
  },
  // 排班信息
  getDeptByHoscode(hoscode) {
    return request({
      url: `${api_url}/getDeptList/${hoscode}`,
      method: 'get'
    })
  },
  // 排班日期
  getScheduleRule(page, limit, hoscode, depcode) {
    return request({
      url: `${api_url}/getScheduleRule/${page}/${limit}/${hoscode}/${depcode}`,
      method: 'get'
    })
  },
  // 查询排班信息
  getScheduleByHoscodeAndDepcodeAndWorkDate(hoscode, depcode, workDate) {
    return request({
      url: `${api_url}/getScheduleDetail/${hoscode}/${depcode}/${workDate}`,
      method: 'get'
    })
  }
}
